package com.kinyx.framework.db.sentence.res;

import com.kinyx.framework.annotation.assist.Tester;
import com.kinyx.framework.db.configs.DBConfigs;
import com.kinyx.framework.db.sentence.CompareType;

/**
 * 比较型表达式子句
 */
@Tester("com.kinyx.framework.db.sentence.res._Expression_COMPARE_TO_Tester_")
class _Expression_COMPARE_TO extends _Expression {

	/** 右边列子句 */
	private final Column columnRight;

	_Expression_COMPARE_TO(final Column columnLeft, final CompareType compareType, final Column columnRight) {
		super(columnLeft, compareType.getValue());
		this.columnRight = columnRight;
	}

	@Override
	public String getSentence(final DBConfigs configs, final boolean isSQL, final boolean withTableAlias) {
		return super.getSentence(configs, isSQL, withTableAlias) + " " + this.columnRight.getSentence(configs, isSQL, withTableAlias);
	}

}
